<!--<template>-->
<!--  <a-modal-->
<!--    :title="currTitle"-->
<!--    :width="450"-->
<!--    :visible="visible"-->
<!--    :closable="false"-->
<!--    :maskClosable="closable">-->
<!--    <template slot="footer">-->
<!--      <a-button v-if="closable" @click="close">关闭</a-button>-->
<!--      <a-button type="primary" @click="departOk">确认</a-button>-->
<!--    </template>-->

<!--    <a-form>-->
<!--      <a-form-item :labelCol="{span:4}" :wrapperCol="{span:20}" style="margin-bottom:10px">-->
<!--        <a-tooltip placement="topLeft" >-->
<!--          <a-avatar style="backgroundColor:#2F54EB" icon="gold" />-->
<!--        </a-tooltip>-->

<!--        <a-select @change="handleDepartChange" v-model="departSelected" placeholder="请选择登录组织" style="margin-left:10px;width: 80%">-->
<!--          <a-icon slot="suffixIcon" type="gold" />-->
<!--          <a-select-option v-for="d in departList" :key="d.id" :value="d.orgCode">-->
<!--            {{ d.departName }}-->
<!--          </a-select-option>-->
<!--        </a-select>-->
<!--      </a-form-item>-->

<!--      <a-form-model-item v-if="hasWarehouse" :labelCol="{span:4}" :wrapperCol="{span:20}" style="margin-bottom:10px" :validate-status="validate_status">-->
<!--        <a-tooltip placement="topLeft" >-->
<!--          <a-avatar style="backgroundColor:#2F54EB;" icon="gold" />-->
<!--        </a-tooltip>-->
<!--        <a-select @change="handleWarehouseChange" v-model="warehouseId" :class="{'valid-error':validate_status=='error'}" placeholder="请选择登录仓库" style="margin-left:10px;width: 80%">-->
<!--          <a-icon slot="suffixIcon" type="gold" />-->
<!--          <a-select-option v-for="d in warehouseList" :key="d.id" :value="d.id">-->
<!--            {{ d.name }}-->
<!--          </a-select-option>-->
<!--        </a-select>-->
<!--      </a-form-model-item>-->



<!--    </a-form>-->


<!--  </a-modal>-->
<!--    -->
<!--</template>-->

<!--<script>-->
<!--  import { getAction,putAction } from '@/api/manage'-->
<!--  import Vue from 'vue'-->
<!--  import store from '@/store/'-->
<!--  import { USER_INFO,WAREHOUSE_ID} from "@/store/mutation-types"-->

<!--  export default {-->
<!--    name: 'DepartSelect',-->
<!--    props:{-->
<!--      title:{-->
<!--        type:String,-->
<!--        default:"组织选择",-->
<!--        required:false-->
<!--      },-->
<!--      closable:{-->
<!--        type:Boolean,-->
<!--        default:false,-->
<!--        required:false-->
<!--      },-->
<!--      username:{-->
<!--        type:String,-->
<!--        default:"",-->
<!--        required:false-->
<!--      }-->
<!--    },-->
<!--    watch:{-->
<!--      username(val){-->
<!--        if(val){-->
<!--          this.loadDepartList()-->
<!--        }-->
<!--      }-->
<!--    },-->
<!--    data(){-->
<!--      return {-->
<!--        currTitle:this.title,-->
<!--        visible:false,-->
<!--        departList:[],-->
<!--        warehouseList:[],-->
<!--        departSelected:"",-->
<!--        validate_status:"",-->
<!--        currDepartName:"",-->
<!--        hasWarehouse:false,-->
<!--        warehouseId:"",-->
<!--      }-->
<!--    },-->
<!--    created(){-->
<!--      //this.loadDepartList()-->
<!--    },-->
<!--    methods:{-->
<!--      loadDepartList(){-->
<!--        return new Promise(resolve => {-->
<!--          let url = "/sys/user/getCurrentUserDeparts"-->
<!--          this.currDepartName=''-->
<!--          getAction(url).then(res=>{-->
<!--            if(res.success){-->
<!--              let departs = res.result.list-->
<!--              let orgCode = res.result.orgCode-->
<!--              if(departs && departs.length>0){-->
<!--                for(let i of departs){-->
<!--                  if(i.orgCode == orgCode){-->
<!--                    this.currDepartName = i.departName-->
<!--                    break-->
<!--                  }-->
<!--                }-->
<!--              }-->
<!--              this.departSelected = orgCode-->
<!--              this.departList  = departs-->
<!--              if(this.currDepartName){-->
<!--                this.currTitle ="组织切换（当前组织 : "+this.currDepartName+"）"-->
<!--              }-->
<!--              this.handleDepartChange(orgCode)-->
<!--            }-->
<!--            resolve()-->
<!--          })-->
<!--        })-->
<!--      },-->
<!--      close(){-->
<!--        this.departClear()-->
<!--      },-->
<!--      handleDepartChange(e){-->
<!--        this.validate_status = ''-->
<!--        this.departSelected = e-->
<!--        return new Promise((resolve, reject)=>{-->
<!--          let obj = {-->
<!--            orgCode:this.departSelected,-->
<!--            username:this.username-->
<!--          }-->
<!--          putAction("/sys/selectDepart",obj).then(res=>{-->
<!--            if(res.success){-->
<!--              const userInfo = res.result.userInfo;-->
<!--              const warehouseInfo = res.result.warehouseInfo;-->
<!--              Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);-->
<!--              this.$store.commit('SET_INFO', userInfo);-->
<!--              if(warehouseInfo){-->
<!--                this.hasWarehouse = true;-->
<!--                this.bizWarehouseList(warehouseInfo);-->
<!--                this.$store.dispatch('saveBeWarehouse', "Y");-->
<!--              }else{-->
<!--                this.warehouseList = [];-->
<!--                this.hasWarehouse = false;-->
<!--                this.$store.dispatch('saveBeWarehouse', "N");-->
<!--                this.handleWarehouseChange(null);-->
<!--              }-->
<!--              //console.log("-&#45;&#45;切换组织机构-&#45;&#45;userInfo-&#45;&#45;&#45;&#45;&#45;&#45;",store.getters.userInfo.orgCode);-->
<!--              resolve();-->
<!--            }else{-->
<!--              this.requestFailed(res)-->
<!--              this.$store.dispatch('Logout');-->
<!--              reject();-->
<!--            }-->
<!--          })-->
<!--        })-->
<!--      },-->
<!--      bizWarehouseList(warehouseInfo){-->
<!--        this.warehouseList = [];-->
<!--        if (Array.isArray(warehouseInfo)) {-->
<!--          if (warehouseInfo.length === 0) {-->
<!--            this.hasWarehouse = false-->
<!--          }else if (warehouseInfo.length === 1) {-->
<!--            this.warehouseId = warehouseInfo[0].id-->
<!--            this.hasWarehouse = false-->
<!--          }else {-->
<!--            this.visible = true-->
<!--            this.hasWarehouse = true-->
<!--            this.warehouseList = warehouseInfo-->
<!--            for(let i of warehouseInfo){-->
<!--              if(i.id == Vue.ls.get(WAREHOUSE_ID)){-->
<!--                this.warehouseId = i.id-->
<!--                break-->
<!--              }-->
<!--            }-->
<!--          }-->
<!--        }-->
<!--      },-->
<!--      handleWarehouseChange(e){-->
<!--        this.validate_status1 = ''-->
<!--        this.warehouseId = e-->
<!--        if(this.warehouseList.length > 0){-->
<!--          for (let i = 0; i < this.warehouseList.length; i++) {-->
<!--            let tMap = this.warehouseList[i];-->
<!--            if(tMap.id === this.warehouseId){-->
<!--              this.$store.dispatch('saveWarehouse', tMap);-->
<!--            }-->
<!--          }-->
<!--        }else{-->
<!--          this.$store.dispatch('saveWarehouse', new Map());-->
<!--        }-->
<!--      },-->
<!--      departOk(){-->
<!--        if(this.hasWarehouse && !this.warehouseId){-->
<!--          this.validate_status='error'-->
<!--          return false-->
<!--        }-->
<!--        let obj = {-->
<!--          orgCode:this.departSelected,-->
<!--          username:this.username-->
<!--        }-->
<!--        putAction("/sys/selectDepart",obj).then(res=>{-->
<!--          if(res.success){-->
<!--            const userInfo = res.result.userInfo;-->
<!--            Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000);-->
<!--            store.commit('SET_INFO', userInfo);-->
<!--            this.departClear();-->
<!--            //重新加载此页面-->
<!--            window.location.reload();-->
<!--          }-->
<!--        })-->
<!--      },-->
<!--      show(){-->
<!--        //如果组件传值username此处就不用loadDepartList了-->
<!--        this.loadDepartList().then(()=>{-->
<!--          this.visible=true-->
<!--          if(!this.departList || this.departList.length<=0){-->
<!--            this.$message.warning("您尚未设置组织信息!")-->
<!--            this.departClear()-->
<!--          }-->
<!--        })-->
<!--      },-->
<!--      departClear(){-->
<!--        this.departList=[]-->
<!--        this.departSelected=""-->
<!--        this.visible=false-->
<!--        this.currDepartName=""-->
<!--      },-->
<!--    }-->

<!--  }-->
<!--</script>-->
<!--<style scoped>-->
<!--  .valid-error .ant-select-selection__placeholder{-->
<!--    color: #f5222d;-->
<!--  }-->
<!--</style>-->